< previous page page_80 next page >

Page 80
0080-01.jpg
Figure 2.18
Program MMeta uses a memory metafile to
copy a drawing several times.
menu to save your drawing to a metafile. Select the Load command from the File menu to load a metafile. The Ch2 directory on the CD-ROM contains some metafiles you can load.
If you have access to a drawing program that can import metafiles, try creating a metafile and importing it into that application. Depending on your application, you may be able to stretch, shrink, rotate, and otherwise manipulate the file.
Example program MMeta, shown in Figure 2.18, uses a memory metafile to copy an image from one picture box into several others. Click and drag the mouse in the upper picture box to draw. When you click the Copy button, the program creates a memory metafile holding your drawing. It then plays the metafile back into each of the other picture boxes.
Summary
You should respect the API but not fear it. It can be an unpredictable nightmare when used recklessly, but it is a powerful tool when used carefully. Save your work often when you use API functions. Wrap API function calls in Visual Basic subroutines that you can call safely. Once you have them working properly, they will allow you to take advantage of features normally hidden from you and extend the boundaries of what you can achieve with Visual Basic.

 
< previous page page_80 next page >